﻿using HLStock.Common;
using HLStock.Model;
using HLStock.WmsService;

namespace HLStock.DBAccess.AOP
{
    public class StockInClearOnDeleteAction : IAfterDeleteAction<StockRecordModel>
    {
        public void Handle(AfterSaveOrDeleteEventArgs<StockRecordModel> arg)
        {
            if (arg.Data.Type == StockType.Out) return;
            ServiceLoader.GetService<StockRecordServiceProvider>().DeleteAllOut(arg.Data.Pk);
        }
    }
}
